<!DOCTYPE HTML>
<title>mytest</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script>

// Tests that the enumerateDevices() returns an array of at least
// one object with the correct fields
promise_test(function() {
  assert_idl_attribute(navigator, 'mediaDevices');
  assert_idl_attribute(navigator.mediaDevices, 'enumerateDevices');

  return navigator.mediaDevices.enumerateDevices().then(function(d) {
    assert_true(d.length > 0);
    assert_idl_attribute(d[0], 'kind');
    assert_idl_attribute(d[0], 'deviceId');
    assert_idl_attribute(d[0], 'label');
    assert_idl_attribute(d[0], 'groupId');
    return Promise.resolve();
  });
}, 'enumerateDevices()');

</script>
